package com.xckj.teacher.ui.activity

import com.blankj.utilcode.util.ToastUtils
import com.xckj.teacher.R
import com.xckj.teacher.databinding.ActivityFeedbackBinding
import com.xckj.teacher.framework.BaseActivity
import com.xckj.teacher.presenter.LoginPresenter
import com.xckj.teacher.presenter.MinePresenter


/**
 * 意见反馈
 */
class FeedBackActivity : BaseActivity<ActivityFeedbackBinding>() {
    private val presenter: MinePresenter by lazy { MinePresenter(this) }

    inner class ProxyClick {
        fun back() {
            finish()
        }

        fun submit() {
            var content = dataBinding.etContent.text.trim().toString()
            if (content.isNullOrEmpty()) {
                ToastUtils.showShort("请输入投诉内容")
                return
            }
            presenter.feedBack(content) {
                finish()
            }
        }

    }

    override fun loadLayout(): Int {
        return R.layout.activity_feedback
    }

    override fun initData() {
        dataBinding.click = ProxyClick()

    }

    override fun setListener() {
//        mViewModel.feedResult.observe(this, Observer {
//            if (it) {
//                finish()
//            }
//        })
    }
}